/*
 * Doctor.java
 *
 * This class is used store details about a doctor.
 *
 * 
 */

package com.javacore.day6.hospital;

import java.util.Scanner;

/**
 * This class simulates the functions
 * and attributes of a Doctor.
 *
 * @author 
 */
public class Doctor {
    
    /** Creates a new instance of Doctor */
    public Doctor() {
        code = 0;
        name = "";
        address = "";
        phone = "";
    }
    
    /**
     * Method to display the doctor information.
     */
    void getDoctorInfo() {
        System.out.println("The details about the doctor are:");
        System.out.println("Code: " + code);
        System.out.println("Address: " + address);
        System.out.println("Phone Number: " + phone);
    }
    
    /**
     * Method to accept the details about a doctor.
     */
    void setDoctorInfo() {
        
        Scanner input = new Scanner(System.in);
        
        // Use the Enter key (new line character) as the delimiter
        input.useDelimiter("\n");
        
        System.out.println("Enter details about the doctor:");
        System.out.println("Enter doctor's code:");
        code = input.nextInt();
        System.out.println("Enter name:");
        name = input.next();
        System.out.println("Enter address:");
        address = input.next();
        System.out.println("Enter phone number:");
        phone = input.next();
    }
    
    /** Instance variable to store unique doctor code. */
    int code;
    
    /** Instance variable to store doctor name. */
    String name;
    
    /** Instance variable to store the address of the doctor. */
    String address;
    
    /** Instance variable to store phone number of the doctor. */
    String phone;
}
